package day10;

public class D10_1Demon {
    public static void main(String[] args) {
        ProjectManager projectManager1=new ProjectManager("张三","PM12345",18000,4000);
        projectManager1.work();
        ProjectManager projectManager2=new ProjectManager("李四","PM54321",22000,5500);
        projectManager2.work();
        Programmer programmer1=new Programmer("王五","PRG12345",12000);
        programmer1.work();
        Programmer programmer2=new Programmer("赵六","RPG54321",12000);
        programmer2.work();

    }
}
class Employee{
    private String name;
    private String employeeNumber;
    private int salary;
    public Employee(){

    }
    public Employee(String name,String employeeNumber,int salary){
        this.name=name;
        this.employeeNumber=employeeNumber;
        this.salary=salary;
        System.out.println("创建员工对象："+name);
    }

    public void work(){
        System.out.println("员工："+name+" 工号："+employeeNumber+"正在工作....");
        System.out.println("工资："+salary);
    }

}
class ProjectManager extends Employee{
    private int bonus;
    public ProjectManager(){
        super();
        this.bonus=0;
    }
    public ProjectManager(String name, String employeeNumber, int salary, int bonus) {
        super(name, employeeNumber, salary);
        System.out.println("创建项目经理对象："+name);
        this.bonus=bonus;
    }

    @Override
    public void work() {
        super.work();
        System.out.println("奖金："+bonus);
    }
}
class Programmer extends Employee{
    public Programmer(){
        super();
    }
    public Programmer(String name, String employeeNumber, int salary) {
        super(name, employeeNumber, salary);
        System.out.println("创建程序员对象："+name);
    }
    @Override
    public void work() {
        super.work();
    }
}